<?php
$arrConfig = $this->mediaConfig;
$arrFolderPermission = $arrConfig["folder_permission"];
$arrFilePermission = $arrConfig["file_permission"];
$this->widget("ext.ELFinder.ElFinderWidget", array(
        'selector' => "div#file-uploader",
        'clientOptions' => array(
            'lang' => "",
            'resizable' => false,
            'wysiwyg' => ''//"ckeditor"
        ),
        'connectorRoute' => "media/connector",
        'connectorOptions' => array(
            'roots' => array(
                array(
                    'driver'  => "LocalFileSystem",
                    'path' => $arrConfig["path"],
                    'URL' => $arrConfig["url"],
		   'uploadMaxSize' => 1024576,
		    'uploadAllow' => array ('image/gif', 'image/png', 'image/jpeg', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/excel', 'application/msword'),
		    'uploadOrder'=> array('allow', 'deny'),
                    'tmbPath' => '',
                    'mimeDetect' => "internal",
                    'accessControl' =>"access",
                    'acceptedName'=> '',
                    'attributes' => array(    
                        array(  
                            'pattern' => $arrFolderPermission["pattern"],
                            'read'   => $arrFolderPermission["read"],
                            'write'   => $arrFolderPermission["write"],
                            'locked' => $arrFolderPermission["locked"],                                    
                            'hidden' => $arrFolderPermission["hidden"],
                        ),
                        array(  
                            'pattern' =>$arrFilePermission["pattern"],
                            'hidden' => $arrFilePermission["hidden"],
                        ),                        
                    ),

                ),                
            )
        )
    ));
    echo '<div id="file-uploader"></div>';
?>
